﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace RAP.Framework.Libary.DataSource.Context
{
	/// <summary>
	/// 
	/// </summary>
	public interface IQueryParams : IDictionary
	{
    /// <summary>
		/// 是否允许调试SQL
		/// </summary>
		bool AllowDebug { get; set; }

    /// <summary>
    /// 是否处于调试状态
    /// </summary>
    bool Debug { get; set; }

		/// <summary>
		/// 数据源Id
		/// </summary>
		string DataSource { get; set; }

		/// <summary>
		/// SQL模板Id
		/// </summary>
		string TemplateId { get; set; }

		/// <summary>
		/// 要执行的Sql语句，如果指定了该值，则会直接执行该语句
		/// </summary>
		string Sql { get; set; }

		/// <summary>
		/// 是否允许空Sql语句，如果为flase，则抛出异常
		/// </summary>
		bool AllowEmptySql { get; set; }

		/// <summary>
		/// 查询结果对象类型
		/// </summary>
		string DataType { get; set; }

		/// <summary>
		/// 是否开发事务
		/// </summary>
		bool NeedTrans { get; set; }

		/// <summary>
		/// 缓存的Key
		/// </summary>
		string CacheProxyKey { get; set; }

    /// <summary>
    /// 将当前查询参数对象复制到目标对象
    /// </summary>
    /// <param name="target"></param>
    /// <returns></returns>
    IQueryParams CopyTo(IQueryParams target);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="src"></param>
    /// <returns></returns>
    IQueryParams CopyFrom(IDictionary src);
  }
}
